using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSRI.HelperClasses;
using System.IO;
using Instedd.Labs.Geo.Library.Sms;

namespace Instedd.Labs.Geo.Library.Tests
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class CsvSenderNameLookupProviderFixture
    {
        public CsvSenderNameLookupProviderFixture()
        {
        }

        [TestMethod]
        public void ExistentCsvNumbersReturnsSenderNamesValues()
        {
            CsvSenderNameLookupProvider provider = new CsvSenderNameLookupProvider("SenderNameLookupTable.csv");

            Assert.AreEqual("Adrian", provider.LookupSenderName("11444445555"));
            Assert.AreEqual("Victor", provider.LookupSenderName("11444445556"));
        }

        [TestMethod]
        public void NonExistentCsvNumbersReturnsTheInputNumber()
        {
            CsvSenderNameLookupProvider provider = new CsvSenderNameLookupProvider("SenderNameLookupTable.csv");

            Assert.AreEqual("11999999", provider.LookupSenderName("11999999"));
        }

        [ExpectedException(typeof(FileNotFoundException))]
        [TestMethod]
        public void NotFoundFileThrows()
        {
            CsvSenderNameLookupProvider provider = new CsvSenderNameLookupProvider("NotFound.csv");
        }
    }
}
